A relay is a switch which is operated electromechanically. One common example of a relay consists of an electromagnet, an armature that is held in place by a spring, and a set of electrical contacts. When the electromagnet is energized, it attracts the armature, pulling it into the contacts, completing an electrical circuit. When current is no longer supplied to the electromagnet, the spring pushes the armature away from the contacts, breaking the circuit. Relays are useful in that they provide isolation between a controlling circuit and the circuit being controlled. This allows, for instance, a low-power circuit to safely control a high-power circuit, or to control several circuits at once.
Typically, relays are relatively large discrete components that must be attached individually to printed circuit boards (PCBs), which can be expensive and cumbersome.